<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>项目列表页</title>
{#    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">#}
    <link rel="stylesheet" href="/static/lightbox/node_modules/bootstrap/dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/static/lightbox/node_modules/prismjs/themes/prism-tomorrow.css"/>
    <style>

    </style>

</head>

<body>
    {% include "menu.html" %}
{#    <div style="text-align: right">#}
{#        <a href="/logout" >注销</a>#}
{#    </div>#}
    <table class="table table-bordered table-striped table-condensed" style="width: 80%; margin-left: 10%; " >
        <thead style="background-color: #050546; color: aliceblue">
            <th>项目标题</th>
            <th>创建者</th>
            <th>操作</th>
        </thead>
        <tbody>
            {% for i in projects %}
                <tr>
                <td>
                    {{ i.name }}
                </td>
                <td>
                    {{ i.creater}}
                </td>
                <td>
                    <a href="/mock_list/{{ i.id }}">进入</a>
                    <a href="/del_project/{{ i.id }}/" onclick="return del_or()">删除</a>
                </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <script>
        function del_or(){
            var message = confirm('删除项目后，项目下面的单元也会被删除，确定删除吗')
            if (message==true){
                return true
            }else{
                return false
            }
        }
    </script>

    <script src="/static/lightbox/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="/static/lightbox/js/bootstrap-show-modal.js"></script>
    <script src="/static/lightbox/node_modules/prismjs/prism.js"></script>

    <script>
        function project_data(){
            $.get('/project_data/',{
            },function (ret){
                $.showModal({title: "项目数据", body: '项目id 项目名称 创建人 运行次数 mock次数 mock单元数'+'<br><br>'+ ret })
            })
        }

    </script>
</body>
</html>